<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
use Hyperf\HttpServer\Router\Router;


Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController@index');

Router::get('/favicon.ico', function () {
    return '';
});

Router::addGroup(
    '/api', function () {
    //用户
    Router::addRoute(['POST'], '/authority/user/login', 'App\Controller\authority\UserController@login'); //用户登录
    //短剧列表
    Router::addRoute(['GET'], '/common/playlet', 'App\Controller\BaseController@playlet');//短剧列表

    Router::addRoute(['GET'], '/common/parentTag', 'App\Controller\BaseController@parentTag');//tag列表
    Router::addRoute(['GET'], '/common/company', 'App\Controller\BaseController@company');//公司列表
},);

Router::addGroup(
    '/api', function () {

    //tag
    Router::addRoute(['GET'], '/playlet/tag/update/{id:\d+}', 'App\Controller\playlet\TagController@update');//短剧更新

    //短剧
    Router::addRoute(['GET'], '/playlet/playlet/update/{id:\d+}', 'App\Controller\playlet\PlayletController@update');//短剧更新
    //短剧集数更新
    Router::addRoute(['GET'], '/playlet/episodes/update/{id:\d+}', 'App\Controller\playlet\PlayletEpisodesController@update');//短剧集数更新
    //修改密码
    Router::addRoute(['POST'], '/authority/user/changePwd', 'App\Controller\authority\UserController@changePwd'); //用户修改密码

    Router::addRoute(['POST'], '/authority/user/changeRealName', 'App\Controller\authority\UserController@changeRealName'); //用户修改昵称
    //banner详情
    Router::addRoute(['GET'], '/playlet/baseBanner/update/{id:\d+}', 'App\Controller\playlet\BaseBannerController@update');//banner详情
    //用户
    Router::addRoute(['GET'], '/playlet/dataUser/update/{id:\d+}', 'App\Controller\playlet\DataUserController@update');//用户详情
    //订单
    Router::addRoute(['GET'], '/playlet/dataOrder/update/{id:\d+}', 'App\Controller\playlet\DataOrderController@update');//用户详情
    //剧集集数
    Router::addRoute(['GET'], '/playlet/playlet/episodes/{id:\d+}', 'App\Controller\playlet\PlayletController@episodes');//剧集集数
    //短剧标签
    Router::addRoute(['GET'], '/playlet/playlet/tag/{id:\d+}', 'App\Controller\playlet\PlayletController@tag');//短剧标签
    //公司
    Router::addRoute(['GET'], '/playlet/company/update/{id:\d+}', 'App\Controller\playlet\CompanyController@update');//公司更新

}, ['middleware' => [\App\Middleware\AuthMiddleware::class]]);

Router::addGroup(
    '/api', function () {
    //短剧列表
    Router::addRoute(['GET'], '/playlet/playlet', 'App\Controller\playlet\PlayletController@index'); //短剧列表
    Router::addRoute(['POST'], '/playlet/playlet/create', 'App\Controller\playlet\PlayletController@create');//短剧创建
    Router::addRoute(['POST'], '/playlet/playlet/update/{id:\d+}', 'App\Controller\playlet\PlayletController@update');//短剧更新
    Router::addRoute(['DELETE'], '/playlet/playlet/delete/{id:\d+}', 'App\Controller\playlet\PlayletController@delete');//短剧删除
    Router::addRoute(['GET'], '/playlet/playlet/episodesList/{id:\d+}', 'App\Controller\playlet\PlayletController@episodesList');//短剧查看剧集
    //短剧标签
    Router::addRoute(['POST'], '/playlet/playlet/tag/{id:\d+}', 'App\Controller\playlet\PlayletController@tag');//短剧标签
    //短剧批量上传集数
    Router::addRoute(['POST'], '/playlet/playlet/batchUpload/{id:\d+}', 'App\Controller\playlet\PlayletController@batchUpload'); //短剧批量上传集数
    //剧集集数列表
    Router::addRoute(['GET'], '/playlet/episodes', 'App\Controller\playlet\PlayletEpisodesController@index'); //集数列表
    Router::addRoute(['POST'], '/playlet/episodes/create', 'App\Controller\playlet\PlayletEpisodesController@create');//集数创建
    Router::addRoute(['POST'], '/playlet/episodes/update/{id:\d+}', 'App\Controller\playlet\PlayletEpisodesController@update');//剧集更新
    Router::addRoute(['DELETE'], '/playlet/episodes/delete/{id:\d+}', 'App\Controller\playlet\PlayletEpisodesController@delete');//集数删除
    //上传图片
    Router::addRoute(['POST'], '/playlet/sts/uploadPath', 'App\Controller\playlet\StsController@uploadPath'); //上传图片

    //公司列表
    Router::addRoute(['GET'], '/playlet/company', 'App\Controller\playlet\CompanyController@index'); //公司列表
    Router::addRoute(['POST'], '/playlet/company/create', 'App\Controller\playlet\CompanyController@create');//公司创建
    Router::addRoute(['POST'], '/playlet/company/update/{id:\d+}', 'App\Controller\playlet\CompanyController@update');//公司更新
    Router::addRoute(['DELETE'], '/playlet/company/delete/{id:\d+}', 'App\Controller\playlet\CompanyController@delete');//公司删除

    //标签列表
    Router::addRoute(['GET'], '/playlet/tag', 'App\Controller\playlet\TagController@index'); //标签列表
    Router::addRoute(['POST'], '/playlet/tag/create', 'App\Controller\playlet\TagController@create');//标签创建
    Router::addRoute(['POST'], '/playlet/tag/update/{id:\d+}', 'App\Controller\playlet\TagController@update');//标签更新
    Router::addRoute(['DELETE'], '/playlet/tag/delete/{id:\d+}', 'App\Controller\playlet\TagController@delete');//标签删除

    //用户列表
    Router::addRoute(['GET'], '/playlet/dataUser', 'App\Controller\playlet\DataUserController@index'); //用户列表
    Router::addRoute(['POST'], '/playlet/dataUser/create', 'App\Controller\playlet\DataUserController@create');//用户创建
    Router::addRoute(['POST'], '/playlet/dataUser/update/{id:\d+}', 'App\Controller\playlet\DataUserController@update');//用户更新
    Router::addRoute(['DELETE'], '/playlet/dataUser/delete/{id:\d+}', 'App\Controller\playlet\DataUserController@delete');//用户删除

    //订单列表
    Router::addRoute(['GET'], '/playlet/dataOrder', 'App\Controller\playlet\DataOrderController@index'); //订单列表
    Router::addRoute(['POST'], '/playlet/dataOrder/create', 'App\Controller\playlet\DataOrderController@create');//订单创建
    Router::addRoute(['POST'], '/playlet/dataOrder/update/{id:\d+}', 'App\Controller\playlet\DataOrderController@update');//订单更新
    Router::addRoute(['DELETE'], '/playlet/dataOrder/delete/{id:\d+}', 'App\Controller\playlet\DataOrderController@delete');//订单删除
    //banner
    Router::addRoute(['GET'], '/playlet/baseBanner', 'App\Controller\playlet\BaseBannerController@index'); //banner列表
    Router::addRoute(['POST'], '/playlet/baseBanner/create', 'App\Controller\playlet\BaseBannerController@create');//banner创建
    Router::addRoute(['POST'], '/playlet/baseBanner/update/{id:\d+}', 'App\Controller\playlet\BaseBannerController@update');//banner更新
    Router::addRoute(['DELETE'], '/playlet/baseBanner/delete/{id:\d+}', 'App\Controller\playlet\BaseBannerController@delete');//banner删除


}, ['middleware' => [\App\Middleware\AuthMiddleware::class,App\Middleware\ValidateMiddleware::class]]
);
